/*
 *    Copyright (c) 2018-2025, boss All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the boss developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: boss
 */

package com.hopes.bizz.poll.pollwqi.entity;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.hopes.bizz.common.core.util.DateUtils;
import com.hopes.boss.common.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

/**
 * 	WQI数据计算
 *
 * @author cx
 * @date 2023-10-16 13:03:00
 */
@Data
@TableName(value = "poll_wqi_data" ,autoResultMap = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description = "WQI指数")
public class PollWqiDataEntity extends BaseEntity {

    private static final long serialVersionUID = 1L;


	/**
	* 标识
	*/
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description="标识")
    private Long id;

	/**
	* 污染程度
	*/
    @Schema(description="污染程度")
    private String name;

	/**
	* 污染级别
	*/
    @Schema(description="污染级别")
    private String level;

	/**
	* 颜色
	*/
    @Schema(description="颜色")
    private String color;


	/**
	* 数据类型
	*/
    @Schema(description="数据类型")
    private Integer dataType;

	/**
	* 数据时间
	*/
    @Schema(description="数据时间")
    private Date dataTime;

	/**
	* 数据
	*/
    @Schema(description="数据")
	@TableField(value = "data_json", typeHandler = JacksonTypeHandler.class)
    private JSONObject dataJson;

	/**
	* 排序
	*/
    @Schema(description="排序")
    private Integer sortNum;

	/**
	* 备注
	*/
    @Schema(description="备注")
    private String remarks;

	/**
	* 机构ID
	*/
    @Schema(description="机构ID")
    private Long orgId;

	public String getDataTimeStr() {
		return DateUtils.limitDay(this.dataTime);
	}
}
